0a895ffefcf9e3888710ec575547d767b2904541,src/main/java/com/net2plan/gui/utils/UndoRedoManager.java,UndoRedoManager,getNavigationBackElement,#,78
Before Change
if (pastInfoVsNewNpCursor == 0) return null;
this.pastInfoVsNewNpCursor--;
final TimelineState currentState = pastInfoVsNewNp.get(this.pastInfoVsNewNpCursor);
final Triple<NetPlan, BidiMap<NetworkLayer, Integer>, Map<NetworkLayer, Boolean>> stateDefinition = currentState.getStateDefinition();
// Making a copy of the current state
// This is made so that in case we go back and make a change, we are able to save the state before then change.
// By reference copying is not useful in this case.
this.backupState = new TimelineState(stateDefinition.getFirst().copy(), new DualHashBidiMap<>(stateDefinition.getSecond()), new HashMap<>(stateDefinition.getThird()));
return stateDefinition;
}
/**
After Change
this.pastInfoVsNewNpCursor--;
final TimelineState currentState = pastInfoVsNewNp.get(this.pastInfoVsNewNpCursor);
this.backupState = createState(currentState.getStateDefinition().getFirst());
return currentState.getStateDefinition();
}